#include "Statistics.h"

void DL::GetRange(const Tensor1D<float>& tensor, float& max, float& min)
{
	min = tensor.Get(0);
	max = tensor.Get(0);
	for (int i = 1; i < tensor.width; i++)
	{
		float value = tensor.Get(i);
		min = min > value ? value : min;
		max = max < value ? value : max;
	}
}

void DL::GetRange(const Tensor1D<int8>& tensor, int8& max, int8& min)
{
	min = tensor.Get(0);
	max = tensor.Get(0);
	for (int i = 1; i < tensor.width; i++)
	{
		int8 value = tensor.Get(i);
		min = min > value ? value : min;
		max = max < value ? value : max;
	}
}
